package chapter04

/**
  * create by unseRdoG on  2021-05-28  17:47
  */
object Test03_Practice99 {
  def main(args: Array[String]): Unit = {
    for (i <- 1 to 9){
      for (j <- 1 to i){
        print(s"$j * $i = ${j * i} \t" )
      }
      println()
    }



    for (i <- 1 to 9; j <- 1 to i ){
        print(s"$j * $i = ${j * i} \t" )
      if (i == j) println()
    }


    /**
    *  循环的返回值   使用  yield  对集合中的每个元素进行操作  返回一个新的数组
    * */

    val res = for (i <- 1 to 10) yield i * 3

    println(res)
  }

}
